<ul id="maintree" class="tree">
<#if (authority.is(3) || authority.is(4) || authority.is(5)) >
	<li class="folder f-open first"><span>系统管理</span>
		<ul>
			<#if authority.is(3)><li id="usersLink" class="doc"><span><a>用户</a></span></li></#if>
			<#if authority.is(4)><li id="rolesLink" class="doc"><span><a>角色</a></span></li></#if>
			<#if authority.is(5)><li id="authLink" class="doc"><span><a>权限</a></span></li></#if>
		</ul>
	</li>
</#if>

	<li class="folder f-open"><span>办公桌面</span>
		<ul>
			<li id="dayschedulerLink" class="doc"><span><a>日程安排</a></span></li>
			<li id="filemangerLink" class="doc"><span><a>个人文件柜</a></span></li>
		</ul>
	</li>
	<li class="folder f-open"><span>控制面板</span>
		<ul>
			<li id="userInfoLink" class="doc"><span><a>个人信息</a></span></li>
			<li id="pswmodLink" class="doc"><span><a>修改密码</a></span></li>
		</ul>
	</li>
</ul>
<script type="text/javascript">

  //导入该页面片段所需的css与js后创建树结构
	new MUI.Require({
			css: [MUI.path.plugins + 'tree/css/style.css'],
			js: [MUI.path.plugins + 'tree/scripts/tree.js'],
			onload: function(){
				if (buildTree) buildTree('maintree');
			}	
	});
	var mainPanel = 'mainPanel';
	
<#if authority.is(3)>	
	$('usersLink').addEvent('click', function(e){
		if ($(mainPanel)){
			MUI.closePanel(mainPanel);
		}
		
		new MUI.Panel({
			id: mainPanel,
			title: '用户',
			contentURL: '/auth/users.action',
			column: 'mainColumn',
			headerToolbox:true,
			headerToolboxURL:'/auth/users.toolbar.action',
			padding: { top: 8, right: 8, bottom: 8, left: 8 },
			collapsible:false
		});
	});
</#if>

<#if authority.is(4)>	
	$('rolesLink').addEvent('click', function(e){
		if ($(mainPanel)){
			MUI.closePanel(mainPanel);
		}
		
		new MUI.Panel({
			id: mainPanel,
			title: '角色',
			contentURL: '/auth/roles.action',
			column: 'mainColumn',
			headerToolbox:true,
			headerToolboxURL:'/auth/role.toolbar.action',
			padding: { top: 8, right: 8, bottom: 8, left: 8 },
			collapsible:false,
		});
		
	});
</#if>	
	
<#if authority.is(5)>	
	$('authLink').addEvent('click', function(e){
		if ($(mainPanel)){
			MUI.closePanel(mainPanel);
		}
		
		new MUI.Panel({
			id: mainPanel,
			title: '权限',
			contentURL: '/auth/auth.action',
			column: 'mainColumn',
			headerToolbox:false,
			padding: { top: 8, right: 8, bottom: 8, left: 8 },
			collapsible:false
		});
		// MUI.splitPanelPanel();
	 
	});
</#if>
	
	$('dayschedulerLink').addEvent('click', function(e){
		if ($(mainPanel)){
			MUI.closePanel(mainPanel);
		}
		
		new MUI.Panel({
			id: mainPanel,
			title: '日程安排',
			loadMethod:'iframe',
			contentURL: '/dayscheduler/scheduler.action',
			column: 'mainColumn',
			headerToolbox:true,
			headerToolboxURL:'/dayscheduler/scheduler.toolbar.action',
			padding: { top: 8, right: 8, bottom: 8, left: 8 },
			collapsible:false
		});
		// MUI.splitPanelPanel();
	 
	});	
	
	$('pswmodLink').addEvent('click', function(e){
		if ($(mainPanel)){
			MUI.closePanel(mainPanel);
		}
	
		new MUI.Panel({
			id: mainPanel,
			title: '修改密码',
			contentURL: '/auth/users.pswmod.action',
			column: 'mainColumn',
			padding: { top: 8, right: 8, bottom: 8, left: 8 },
			collapsible:false
		});
	});
	
	$('userInfoLink').addEvent('click', function(e){
		if ($(mainPanel)){
			MUI.closePanel(mainPanel);
		}
	
		new MUI.Panel({
			id: mainPanel,
			title: '个人信息',
			contentURL: '/auth/users.info.action',
			column: 'mainColumn',
			padding: { top: 8, right: 8, bottom: 8, left: 8 },
			collapsible:false
		});
	});
	
	$('filemangerLink').addEvent('click', function(e){
		if ($(mainPanel)){
			MUI.closePanel(mainPanel);
		}
	
		new MUI.Panel({
			id: mainPanel,
			title: '文件管理',
			loadMethod:'iframe',
			contentURL: '/filemanager/filemanager.action',
			column: 'mainColumn',
			//headerToolbox:true,
			//headerToolboxURL:'/filemanager/filemanager.toolbar.action',
			padding: { top: 8, right: 8, bottom: 8, left: 8 },
			collapsible:false
		});
	});
	
</script>
